package com.coffee.admin.service.merchant.dao;


import com.coffee.admin.api.merchant.query.MerchantInvoiceQuery;
import com.coffee.admin.service.merchant.bean.MerchantInvoice;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MerchantInvoiceDao {
    public MerchantInvoice findByIdAndMerchantId(@Param("id") Integer id, @Param("merchantId") Integer merchantId);

    public MerchantInvoice findById(Integer id);

    public MerchantInvoice findByIdForUpdate(Integer id);

    public List<MerchantInvoice> findByIds(@Param("idList") List<Integer> idList);

    public Integer count(@Param("param") MerchantInvoiceQuery param);

    public List<MerchantInvoice> page(@Param("param") MerchantInvoiceQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public MerchantInvoice findFirst(@Param("param") MerchantInvoiceQuery param);

    public Integer insert(MerchantInvoice param);

    Integer insertBatch(List<MerchantInvoice> list);

    public void updateById(@Param("param") MerchantInvoice param);

    public Integer deleteById(Integer id);

    public Integer deleteByIdAndMerchantId(@Param("id") Integer id, @Param("merchantId") Integer merchantId);

    public Integer deleteByIds(List<Integer> idList);

    public Integer updateIsDefaultByMerchantId(@Param("merchantId") Integer merchantId);

}